﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Ping: com.stateforge.statemachine.examples.ping.EchoServerHandler Class Reference</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderJava
            </h1>
            <h3>
                Ping: com.stateforge.statemachine.examples.ping.EchoServerHandler Class Reference
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacecom.html">com</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge.html">stateforge</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge_1_1statemachine.html">statemachine</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge_1_1statemachine_1_1examples.html">examples</a>      </li>
      <li class="navelem"><a class="el" href="namespacecom_1_1stateforge_1_1statemachine_1_1examples_1_1ping.html">ping</a>      </li>
      <li class="navelem"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html">EchoServerHandler</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">com.stateforge.statemachine.examples.ping.EchoServerHandler Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="com::stateforge::statemachine::examples::ping::EchoServerHandler" --><!-- doxytag: inherits="org::jboss::netty::channel::SimpleChannelUpstreamHandler" -->
<p>Inherits SimpleChannelUpstreamHandler.</p>

<p><a href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a8e3cf4e4cc603aa1305b455d465cae79">getTransferredBytes</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a276bef264e7930a53711fe2c6a8d1cec">messageReceived</a> (ChannelHandlerContext ctx, MessageEvent e)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a2ca319c0635c124b66415106a16fdad5">exceptionCaught</a> (ChannelHandlerContext ctx, ExceptionEvent e)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">final AtomicLong&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a30e3482790e9db81e1fde2dcd4c24c1b">transferredBytes</a> = new AtomicLong()</td></tr>
<tr><td colspan="2"><h2><a name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static final Logger&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a539f8b5bb01d1f03d0b4e99c80ea110e">logger</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Handler implementation for the echo server.</p>
<dl class="author"><dt><b>Author:</b></dt><dd><a href="http://www.jboss.org/netty/">The Netty Project</a> </dd>
<dd>
<a href="http://gleamynode.net/">Trustin Lee</a></dd></dl>
<dl class="version"><dt><b>Version:</b></dt><dd></dd></dl>
<dl class="rcs"><dt><b>Rev:</b></dt><dd>2121 </dd></dl>
<p>, </p>
<dl class="rcs"><dt><b>Date:</b></dt><dd>2010-02-02 09:38:07 +0900 (Tue, 02 Feb 2010) </dd></dl>

<p>Definition at line <a class="el" href="_echo_server_handler_8java_source.html#l00036">36</a> of file <a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2ca319c0635c124b66415106a16fdad5"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServerHandler::exceptionCaught" ref="a2ca319c0635c124b66415106a16fdad5" args="(ChannelHandlerContext ctx, ExceptionEvent e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void com.stateforge.statemachine.examples.ping.EchoServerHandler.exceptionCaught </td>
          <td>(</td>
          <td class="paramtype">ChannelHandlerContext&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ExceptionEvent&#160;</td>
          <td class="paramname"><em>e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_handler_8java_source.html#l00056">56</a> of file <a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a>.</p>
<div class="fragment"><pre class="fragment">                                                         {
        <span class="comment">// Close the connection when an exception is raised.</span>
        <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a539f8b5bb01d1f03d0b4e99c80ea110e">logger</a>.log(
                Level.WARNING,
                <span class="stringliteral">&quot;Unexpected exception from downstream.&quot;</span>,
                e.getCause());
        e.getChannel().close();
    }
</pre></div>
</div>
</div>
<a class="anchor" id="a8e3cf4e4cc603aa1305b455d465cae79"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServerHandler::getTransferredBytes" ref="a8e3cf4e4cc603aa1305b455d465cae79" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long com.stateforge.statemachine.examples.ping.EchoServerHandler.getTransferredBytes </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_handler_8java_source.html#l00043">43</a> of file <a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a>.</p>
<div class="fragment"><pre class="fragment">                                      {
        <span class="keywordflow">return</span> <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a30e3482790e9db81e1fde2dcd4c24c1b">transferredBytes</a>.get();
    }
</pre></div>
</div>
</div>
<a class="anchor" id="a276bef264e7930a53711fe2c6a8d1cec"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServerHandler::messageReceived" ref="a276bef264e7930a53711fe2c6a8d1cec" args="(ChannelHandlerContext ctx, MessageEvent e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void com.stateforge.statemachine.examples.ping.EchoServerHandler.messageReceived </td>
          <td>(</td>
          <td class="paramtype">ChannelHandlerContext&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">MessageEvent&#160;</td>
          <td class="paramname"><em>e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_handler_8java_source.html#l00048">48</a> of file <a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a>.</p>
<div class="fragment"><pre class="fragment">                                                       {
        <span class="comment">// Send back the received message to the remote peer.</span>
        <a class="code" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a30e3482790e9db81e1fde2dcd4c24c1b">transferredBytes</a>.addAndGet(((ChannelBuffer) e.getMessage()).readableBytes());
        e.getChannel().write(e.getMessage());
    }
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a539f8b5bb01d1f03d0b4e99c80ea110e"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServerHandler::logger" ref="a539f8b5bb01d1f03d0b4e99c80ea110e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final Logger <a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a539f8b5bb01d1f03d0b4e99c80ea110e">com.stateforge.statemachine.examples.ping.EchoServerHandler.logger</a><code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Initial value:</b><div class="fragment"><pre class="fragment"> Logger.getLogger(
            EchoServerHandler.class.getName())
</pre></div>
<p>Definition at line <a class="el" href="_echo_server_handler_8java_source.html#l00038">38</a> of file <a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a>.</p>

</div>
</div>
<a class="anchor" id="a30e3482790e9db81e1fde2dcd4c24c1b"></a><!-- doxytag: member="com::stateforge::statemachine::examples::ping::EchoServerHandler::transferredBytes" ref="a30e3482790e9db81e1fde2dcd4c24c1b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final AtomicLong <a class="el" href="classcom_1_1stateforge_1_1statemachine_1_1examples_1_1ping_1_1_echo_server_handler.html#a30e3482790e9db81e1fde2dcd4c24c1b">com.stateforge.statemachine.examples.ping.EchoServerHandler.transferredBytes</a> = new AtomicLong()<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_echo_server_handler_8java_source.html#l00041">41</a> of file <a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/main/java/com/stateforge/statemachine/examples/ping/<a class="el" href="_echo_server_handler_8java_source.html">EchoServerHandler.java</a></li>
</ul>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
